package com.songlanyun.modules.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.songlanyun.common.validator.ValidatorUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.common.utils.Query;

import com.songlanyun.modules.order.dao.SaleServiceOrderContactsDao;
import com.songlanyun.modules.order.entity.SaleServiceOrderContacts;
import com.songlanyun.modules.order.service.SaleServiceOrderContactsService;


@Service("saleServiceOrderContactsService")
public class SaleServiceOrderContactsServiceImpl extends ServiceImpl<SaleServiceOrderContactsDao, SaleServiceOrderContacts> implements SaleServiceOrderContactsService {


    @Override
    public SaleServiceOrderContacts create(SaleServiceOrderContacts entity) {
        ValidatorUtils.validateEntity(entity);
        this.baseMapper.insert(entity);
        return entity;
    }


    @Override
    public SaleServiceOrderContacts modify(SaleServiceOrderContacts entity) {
        return null;
    }



    @Override
    public void remove(Long id) {

    }

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        return null;
    }

    @Override
    public SaleServiceOrderContacts loadByOrderId(Long orderId) {
        SaleServiceOrderContacts contacts = this.getOne(new LambdaQueryWrapper<SaleServiceOrderContacts>().eq(SaleServiceOrderContacts::getOrderId, orderId)
                .last("limit 1"));
        return contacts;
    }
}